<!DOCTYPE html>
<?php

require_once './system/config.php';//Include de configuração



// Conexão com o banco de dados ////////////////////////////////////////////////////////////////////////////////////
$conn = new db();
$conn->open();

if($_SESSION['logado']  != 1){
     header("location: index.php?p=login");
}

$tpl = new TemplatePower( VIEW_PATH."principal.html" );//instancia objeto TemplatePower, cria view no html principal
$tpl->assignGlobal('APP_NAME', APP_NAME);//seta variavel global
$tpl->assignInclude( "modulos", VIEW_PATH."modules/mod-noticia/view-cadastra-noticia.html" );
$tpl->assignInclude( "menu", VIEW_PATH."modules/mod-menu/menu.html" );
$tpl->prepare();
/*
$teste = DBUtils::getRows("select * from usuarios");


foreach ($teste as $row):
        $tpl->newBlock( "test" );
        $tpl->assign(Array(  "teste" => $row['nome'], "id" => $row['id_user']));
endforeach;*/

$tpl->printToScreen();

$conn->close();

var_dump($_SESSION['logado']);